/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Items;

import ElementsProperties.Activable;
import Actors.Actor;
import Actors.HumanControlledBall;
import ElementsProperties.ActorEntranceSensible;

/**
 *
 * @author vf
 */
public class Umbrella extends Item implements Activable,ActorEntranceSensible {

    @Override
    public void update(long dtime) {
    }


    @Override
    public void setImage() {
        itemImage=EnigmaUtils.ImageLoader.loadImage("./images/it-umbrella.png");
    }

    public void actOn(HumanControlledBall playerBall) {
        playerBall.invincibleFor(1200);
        inventory.removeItem(this);
    }

    public void collected() {
    }

    public boolean isCollectable() {
        return true;
    }

    public void actorEnters(Actor a) {
        if(a instanceof HumanControlledBall)
            goToInventory();
    }

    public void actorLeaves(Actor a) {
    }
}
